/*
 * @(#)ResponseStatus.java
 * Date 2013-04-11
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.registry.constant;

/**
 *
 * @author jim
 */
public enum ResponseStatus {

    Failure("urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Failure"),
    PartialSuccess("urn:ihe:iti:2007:ResponseStatusType:PartialSuccess"),
    Success("urn:oasis:names:tc:ebxml-regrep:ResponseStatusType:Success");

    /** Field description */
    private final String code;

    /**
     * Constructs ...
     *
     *
     * @param code
     */
    private ResponseStatus(String c) {
        this.code = c;
    }

    /**
     * Method description
     *
     *
     * @param code
     *
     * @return
     */
    public static ResponseStatus toResponseStatus(String c) {

        ResponseStatus result = null;

        for (ResponseStatus myc : values()) {

            if (myc.code.equals(c)) {

                result = myc;

                break;
            }
        }

        return result;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public String getCode() {

        return this.code;
    }
}
